package com.dfbz.springboot_project.entity;

import javax.persistence.*;
import java.util.Date;
import java.util.Objects;

@Entity
@Table(name = "service_update", schema = "netctoss")
public class ServiceUpdate {
    private Integer id;
    private String osUsername;
    private Date serviceCreateDate;

    @Id
    @Column(name = "id", nullable = false)
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @Basic
    @Column(name = "os_username", nullable = false, length = 8)
    public String getOsUsername() {
        return osUsername;
    }

    public void setOsUsername(String osUsername) {
        this.osUsername = osUsername;
    }

    @Basic
    @Column(name = "service_create_date", nullable = true)
    public Date getServiceCreateDate() {
        return serviceCreateDate;
    }

    public void setServiceCreateDate(Date serviceCreateDate) {
        this.serviceCreateDate = serviceCreateDate;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ServiceUpdate that = (ServiceUpdate) o;
        return id == that.id &&
                Objects.equals(osUsername, that.osUsername) &&
                Objects.equals(serviceCreateDate, that.serviceCreateDate);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, osUsername, serviceCreateDate);
    }
}
